Day 16 - Regular expressions - Multiple matches

89

$ grep -Eo "GET .*" simple.log

GET /presentations/logstash-monitorama-2013/images/kibana-search.png HTTP/1.1 200 20\

3023 http://semicomplete.com/presentations/logstash-monitorama-2013/

GET /presentations/logstash-monitorama-2013/images/kibana-dashboard3.png HTTP/1.1 20\

0 171717 http://semicomplete.com/presentations/logstash-monitorama-2013/

GET /presentations/logstash-monitorama-2013/plugin/highlight/highlight.js HTTP/1.1 2\

00 26185 http://semicomplete.com/presentations/logstash-monitorama-2013/

[...]

The pattern .* is one of the most common ones in regular expressions. As . matches any character

and * matches 0 or more repetitions of the previous component, .* means any repetition of any

character, or “anything” for short. This is extremely useful whenever there are long parts of a line

that you want to manage without writing a (probably very complex and long) regular expressions

that matches them.

Go back to the exercise